;;; *************************************************************************
;;;; FILE IDENTIFICATION
;;;;
;;;; Name:          package.lisp
;;;; Purpose:       Audioscrobbler/lastfm wrapper
;;;; Programmer:    Nicolas Lamirault <nicolas.lamirault@gmail.com>
;;;;
;;;; This file, part of audioscrobbler, is Copyright (c) 2006 by Nicolas Lamirault
;;;;
;;;; cl-audioscrobbler users are granted the rights to distribute and use this software
;;;; as governed by the terms of the MIT License :
;;;; http://www.opensource.org/licenses/mit-license.php
;;;;
;;;; *************************************************************************


(in-package :cl-audioscrobbler)

;; ------------------
;; HTTP Web Services
;; ------------------

;; User

(unless (boundp '+user-profile-information+)
 (defconstant +user-profile-information+
   "http://ws.audioscrobbler.com/1.0/user/~A/profile.xml"))

(unless (boundp '+user-top-artists+)
 (defconstant +user-top-artists+
   "http://ws.audioscrobbler.com/1.0/user/~A/topartists.xml"))

(unless (boundp '+user-top-albums+)
 (defconstant +user-top-albums+
   "http://ws.audioscrobbler.com/1.0/user/~A/topalbums.xml"))

(unless (boundp '+user-top-tracks+)
 (defconstant +user-top-tracks+
   "http://ws.audioscrobbler.com/1.0/user/~A/toptracks.xml"))

(unless (boundp '+user-top-tags+)
 (defconstant +user-top-tags+
   "http://ws.audioscrobbler.com/1.0/user/~A/tags.xml"))

(unless (boundp '+user-top-tags-artist+)
 (defconstant +user-top-tags-artist+
   "http://ws.audioscrobbler.com/1.0/user/~A/artisttags.xml?artist=~A"))

(unless (boundp '+user-top-tags-album+)
 (defconstant +user-top-tags-album+
   "http://ws.audioscrobbler.com/1.0/user/~A/albumtags.xml?artist=~A&album=~A"))

(unless (boundp '+user-top-tags-track+)
 (defconstant +user-top-tags-track+
   "http://ws.audioscrobbler.com/1.0/user/~A/tracktags.xml?artist=~A&track=~A"))

(unless (boundp '+user-friends+)
 (defconstant +user-friends+
   "http://ws.audioscrobbler.com/1.0/user/~A/friends.xml"))

(unless (boundp '+user-neighbours+)
 (defconstant +user-neighbours+
   "http://ws.audioscrobbler.com/1.0/user/~A/neighbours.xml"))

(unless (boundp '+user-recent-tracks+)
 (defconstant +user-recent-tracks+
   "http://ws.audioscrobbler.com/1.0/user/~A/recenttracks.xml"))

(unless (boundp '+user-weekly-artist+)
 (defconstant +user-weekly-artist+
   "http://ws.audioscrobbler.com/1.0/user/~A/weeklyartistchart.xml"))

(unless (boundp '+user-weekly-album+)
 (defconstant +user-weekly-album+
   "http://ws.audioscrobbler.com/1.0/user/~A/weeklyalbumchart.xml"))

(unless (boundp '+user-weekly-track+)
 (defconstant +user-weekly-track+
   "http://ws.audioscrobbler.com/1.0/user/~A/weeklytrackchart.xml"))


(unless (boundp '+user-taste-o-meter+)
  (defconstant +user-taste-o-meter+
    "http://ws.audioscrobbler.com/1.0/user/~A/tasteometer.xml?with=~A"))


;; Artist

(unless (boundp '+artist-related+)
 (defconstant +artist-related+
   "http://ws.audioscrobbler.com/1.0/artist/~A/similar.xml"))

(unless (boundp '+artist-top-albums+)
 (defconstant +artist-top-albums+
   "http://ws.audioscrobbler.com/1.0/artist/~A/topalbums.xml"))

(unless (boundp '+artist-top-tracks+)
 (defconstant +artist-top-tracks+
   "http://ws.audioscrobbler.com/1.0/artist/~A/toptracks.xml"))

(unless (boundp '+artist-top-fans+)
  (defconstant +artist-top-fans+
    "http://ws.audioscrobbler.com/1.0/artist/~A/fans.xml"))

(unless (boundp '+artist-top-tags+)
  (defconstant +artist-top-tags+
    "http://ws.audioscrobbler.com/1.0/artist/~A/toptags.xml"))

;; Album

(unless (boundp '+album-info+)
  (defconstant +album-info+
    "http://ws.audioscrobbler.com/1.0/album/~A/~A/info.xml"))


;; Tag


(unless (boundp '+top-tags+)
  (defconstant +top-tags+
    "http://ws.audioscrobbler.com/1.0/tag/toptags.xml"))

(unless (boundp '+top-artists+)
  (defconstant +top-artists+
    "http://ws.audioscrobbler.com/1.0/tag/~A/topartists.xml"))

(unless (boundp '+top-albums+)
  (defconstant +top-albums+
    "http://ws.audioscrobbler.com/1.0/tag/~A/topalbums.xml"))

(unless (boundp '+top-tracks+)
  (defconstant +top-tracks+
    "http://ws.audioscrobbler.com/1.0/tag/~A/toptracks.xml"))


;; Track


(unless (boundp '+track-fans+)
  (defconstant +track-fans+
    "http://ws.audioscrobbler.com/1.0/track/~A/~A/fans.xml"))


(unless (boundp '+track-tags+)
  (defconstant +track-tags+
    "http://ws.audioscrobbler.com/1.0/track/~A/~A/toptags.xml"))



;; ---------------------
;; HTTP IO Protocol 1.1
;; ---------------------


(unless (boundp '+client-id+)
  (defconstant +client-id+ "tst"))

(unless (boundp '+client-version+)
  (defconstant +client-version+ "1.0"))


(unless (boundp '+protocol-identify-1.1+)
 (defconstant +protocol-identify-1.1+
   "http://post.audioscrobbler.com/?hs=true&p=1.1&c=~A&v=~A&u=~A"))


(unless (boundp '+protocol-post-1.1+)
 (defconstant +protocol-post-1.1+
   "u=~A&s=~A&a%5B0%5D=~A&t%5B0%5D=~A&b%5B0%5D=~A&m%5B0%5D=~A&l%5B0%5D=~A&i%5B0%5D=~A"))


(unless (boundp '+protocol-identify-1.2+)
 (defconstant +protocol-identify-1.2+
   "http://post.audioscrobbler.com/?hs=true&p=1.2&c=~A&v=~A&u=~A&t=~A&a=~A"))


(unless (boundp '+protocol-post-1.2+)
 (defconstant +protocol-post-1.2+
   "a%5b0%5d=~A&t%5b0%5d=~A&b%5b0%5d=~A&m%5b0%5d=~A&l%5b0%5d=~A&i%5b0%5d=~A&u=~A&"))


;; ------
;; Ouput
;; ------


(defparameter *debug* nil "If T activate some logs.")


(defparameter *print-audioscrobbler* nil
  "If T, write the customized presentation of the Audioscrobbler objects.")
